﻿<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %> 
<%@ Import Namespace="System.Data.SqlClient" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    
    private void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack) LoadData();
    }

    public void LoadData()
    {
        SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM orders", "server=(local);database=northwind;Integrated Security=SSPI");
        DataTable table = new DataTable();
        adapter.Fill(table);
        Repeater1.DataSource = table; Repeater1.DataBind();
    } 
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Repeater runat="server" id="Repeater1"> 
 <itemtemplate> 
    <b><%# DataBinder.Eval(Container.DataItem, "orderid") %></b>
     <br>Due by: <%# DataBinder.Eval(Container.DataItem, "orderdate", "{0:d}") %> 
     &nbsp;&nbsp;&nbsp; Shipped: <%# DataBinder.Eval(Container.DataItem, "shippeddate", "{0:d}") %> 
     </itemtemplate> <separatortemplate> <hr> </separatortemplate> </asp:Repeater> 
    </div>
    </form>
</body>
</html>
